﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/manage.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="Management_Articles_List" Theme="DataWebControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/xheditor/xheditor-1.1.13-zh-cn.min.js") %>"></script>
    <script language="javascript" type="text/javascript">
    function formvalidate() {
        var result = true;
        $(".required").each(function () {
            if ($.trim($(this).val()) == "") {
                $(this).next().text("* required!");
                result = false;
            }
            else {
                $(this).next().text("*");
            }
        });
        $("#<%=txtContent.ClientID %>").val(editor.getSource());
        return result;
    }
    var editor = '';
    $(function () {
        editor = $('#<%=txtContent.ClientID %>').xheditor({ upLinkUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upLinkExt: "zip,rar,txt", upImgUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upImgExt: "jpg,jpeg,gif,png", upFlashUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upFlashExt: "swf", upMediaUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upMediaExt: "wmv,avi,wma,mp3,mid" });
    });

    function InitEditor() {
        editor = $('#<%=txtContent.ClientID %>').xheditor({ upLinkUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upLinkExt: "zip,rar,txt", upImgUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upImgExt: "jpg,jpeg,gif,png", upFlashUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upFlashExt: "swf", upMediaUrl: '<%=ResolveUrl("~/Scripts/xheditor/upload.aspx") %>', upMediaExt: "wmv,avi,wma,mp3,mid" });
    }
    </script>
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h2 class="clearfix">
                <span class="float_l">文章列表</span>
            </h2>
            <asp:Panel ID="Panel1" runat="server" CssClass="block">
                <table class="table">
                    <tr>
                        <td class="field">ID:</td>
                        <td><asp:Label ID="lblID" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="field">文章所属类型:</td>
                        <td>
                            <asp:DropDownList ID="ddlType" runat="server">
                                <asp:ListItem Text="品牌文化" Value="0" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="SeDuce合作" Value="1"></asp:ListItem>
                                <asp:ListItem Text="购买方法" Value="2"></asp:ListItem>
                                <asp:ListItem Text="支付信息说明" Value="3"></asp:ListItem>
                                <asp:ListItem Text="联系Se'Duce" Value="4"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="field">标题:</td>
                        <td>
                            <asp:TextBox ID="txtTitle" runat="server" CssClass="required text"></asp:TextBox><span class="color_red margin5_lr">*</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="field">文章内容:</td>
                        <td>
                            <textarea id="txtContent" name="txtContent" style="width:800px;height:400px;" runat="server"></textarea><span class="color_red margin5_lr">*</span>
                        </td>
                    </tr>
                </table>
                <div class="margin10_tb">
                    <asp:LinkButton ID="lbtnSave" runat="server" 
                        OnClientClick="javascript:return formvalidate();" CssClass="btn" 
                        onclick="lbtnSave_Click">保存</asp:LinkButton>
                    <asp:LinkButton ID="lbtnCancel" runat="server" 
                        OnClientClick="javascript:window.location.reload();" CssClass="btn">取消</asp:LinkButton>
                </div>
            </asp:Panel>
            <div class="margin10_tb">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onrowcommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="ID">
                            <ItemTemplate>
                                <asp:Label ID="lblID" runat="server" Text='<%#Eval("ID").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="标题(用于定位前台页面)">
                            <ItemTemplate>
                                <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("Title").ToString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="文章所属分类">
                            <ItemTemplate>
                                <asp:Label ID="lblType" runat="server" Text='<%#(Eval("Type").ToString()=="0")?"品牌文化":(Eval("Type").ToString()=="1"?"SeDuce合作":(Eval("Type").ToString()=="2"?"购买方法":(Eval("Type").ToString()=="3"?"支付信息说明":"联系SeDuce"))) %>'></asp:Label>
                                <asp:Label ID="hidTypeID" Text='<%#Eval("Type").ToString()%>' Visible="false" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lbtnEdit" CommandName="MOD" runat="server" CssClass="btn">编辑</asp:LinkButton>
                                <asp:LinkButton ID="lbtnDelete" CommandName="DEL" runat="server" CssClass="btn" OnClientClick="javascript:return confirm('确认删除么？');">删除</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <div class="pager margin10_tb">
                <asp:Repeater ID="rptPageFliper" runat="server">
                    <ItemTemplate>
                        <span class='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "current": string.Empty%>' class="paging">
                            <asp:LinkButton ID="lbtnPager" runat="server" CommandName="<%# ((PageNumberItem)Container.DataItem).PageNumberCommand%>"
                                Text="<%# ((PageNumberItem)Container.DataItem).PageNumberText%>" Enabled='<%# !(((PageNumberItem)Container.DataItem).IsCurrentPage) %>'
                                Style='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "color:#eee;": "color:#eee;"%>'
                                Font-Underline="false"></asp:LinkButton>
                        </span>
                    </ItemTemplate>
                </asp:Repeater>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

